package org.example.springcloud.service;

import org.example.springcloud.entities.Payment;
import org.example.springcloud.result.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * Created with IntelliJ IDEA.
 *
 * @author Jandmla
 * Date: 2022/8/3
 * Time: 10:24
 * Description:
 */
@Component
@FeignClient(value = "CLOUD-PROVIDER-HYSTRIX-PAYMENT-SERVICE")
public interface PaymentFeignService {

    /**
     * OpenFeign调用正常接口
     * @param id id
     * @return 查询结果
     */
    @GetMapping("/payment/hystrix/ok/{id}")
    public CommonResult<String> paymentInfo_OK(@PathVariable("id") Long id);

    /**
     * OpenFeign调用超时接口
     * @return 端口号
     */
    @GetMapping("/payment/hystrix/timeout/{id}")
    public CommonResult<String> paymentInfo_TimeOut(@PathVariable("id") Long id);
}